From: Glenn Morris Date: Tue, 8 Jan 2008 05:19:13 +0000 (+0000) Subject: (diff-end-of-hunk): Don't match empty lines in unified format. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~18855^2~811 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=1c6aa2f55f3b54ec27799c9e36a7b737ec81112a;p=emacs.git (diff-end-of-hunk): Don't match empty lines in unified format. --- diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index 4c566b344a9..a088cd6ccba 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el @@ -391,9 +391,13 @@ when editing big diffs)." ;; Especially important for unified (because headers are ambiguous). (setq style (cdr (assq (char-after) '((?@ . unified) (?* . context)))))) (goto-char (match-end 0))) + ;; Some versions of diff replace all-blank context lines in unified + ;; format with empty lines. The use of \n below avoids matching such + ;; lines as headers. + ;; http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01990.html (let ((end (and (re-search-forward (case style ;; A `unified' header is ambiguous. - (unified (concat "^[^-+# \\]\\|" + (unified (concat "^[^-+# \\\n]\\|" diff-file-header-re)) (context "^[^-+#! \\]") (normal "^[^<>#\\]")